🎯 integration 流程圖

AIVA 跨模組流程圖組合視覺化

54
流程圖總數
0
序列圖
54
流程圖
2025-10-17
生成日期

📑 目錄

1. core aiva core ai integration test Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAIVA AI 整合測試系統\n測試統一 AI 控制器、自然語言生成器和多語言協調器...] n4[import asyncio] n5[from dataclasses import dataclass] n6[import json] n7[import os] n8[from pathlib import Path] n9[import sys] n10[import time] n11[from typing import Any] n12[sys.path.append(os.path.join(os.path.dirname(...] n13[from ai_controller import UnifiedAIController] n14[from ai_engine.bio_neuron_rag_agent import BioNeur...] n15[from multilang_coordinator import MultiLanguageAIC...] n16[from nlg_system import AIVANaturalLanguageGenerato...] n17[class TestResult(...)] n18[class AIIntegrationTester(...)] n19[def main(...)] n20{if __name__ == '__main__'} n21[asyncio.run(main())] n22[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 -->|Yes| n21 n20 -->|No| n22 n21 --> n22 n22 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAIVA AI 整合測試系統\n測試統一 AI 控制器、自然語言生成器和多語言協調器...]
    n4[import asyncio]
    n5[from dataclasses import dataclass]
    n6[import json]
    n7[import os]
    n8[from pathlib import Path]
    n9[import sys]
    n10[import time]
    n11[from typing import Any]
    n12[sys.path.append(os.path.join(os.path.dirname(...]
    n13[from ai_controller import UnifiedAIController]
    n14[from ai_engine.bio_neuron_rag_agent import BioNeur...]
    n15[from multilang_coordinator import MultiLanguageAIC...]
    n16[from nlg_system import AIVANaturalLanguageGenerato...]
    n17[class TestResult(...)]
    n18[class AIIntegrationTester(...)]
    n19[def main(...)]
    n20{if __name__ == '__main__'}
    n21[asyncio.run(main())]
    n22[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 -->|Yes| n21
    n20 -->|No| n22
    n21 --> n22
    n22 --> n2
2. core aiva core rag demo rag integration Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nRAG 與 AI Agent 集成示例\n\n展示如何將 RAG 引擎與 BioNe...] n4[from __future__ import annotations] n5[import asyncio] n6[import logging] n7[from aiva_core.rag import KnowledgeBase, RAGEngine...] n8[from services.aiva_common.schemas import AttackPla...] n9[logger = logging.getLogger(__...] n10[class AIAgentWithRAG(...)] n11[def demo_rag_integration(...)] n12{if __name__ == '__main__'} n13[logging.basicConfig(level=logging.INFO, format=&&...] n14[asyncio.run(demo_rag_integration())] n15[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 -->|Yes| n13 n12 -->|No| n15 n13 --> n14 n14 --> n15 n15 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nRAG 與 AI Agent 集成示例\n\n展示如何將 RAG 引擎與 BioNe...]
    n4[from __future__ import annotations]
    n5[import asyncio]
    n6[import logging]
    n7[from aiva_core.rag import KnowledgeBase, RAGEngine...]
    n8[from services.aiva_common.schemas import AttackPla...]
    n9[logger = logging.getLogger(__...]
    n10[class AIAgentWithRAG(...)]
    n11[def demo_rag_integration(...)]
    n12{if __name__ == '__main__'}
    n13[logging.basicConfig(level=logging.INFO, format=&&...]
    n14[asyncio.run(demo_rag_integration())]
    n15[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 -->|Yes| n13
    n12 -->|No| n15
    n13 --> n14
    n14 --> n15
    n15 --> n2
3. integration init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAIVA Integration - 整合模組\n\n這是 AIVA 的整合模組包,...] n4[__version__ = '1.0.0'] n5[from ..aiva_common.enums import IntelSource, Sever...] n6[from .models import EnhancedIOCRecord, Notificatio...] n7[__all__ = ['IntelSource', &am...] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAIVA Integration - 整合模組\n\n這是 AIVA 的整合模組包,...]
    n4[__version__ = '1.0.0']
    n5[from ..aiva_common.enums import IntelSource, Sever...]
    n6[from .models import EnhancedIOCRecord, Notificatio...]
    n7[__all__ = ['IntelSource', &am...]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
4. integration aiva integration init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
5. integration aiva integration analysis init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
6. integration aiva integration analysis compliance policy checker Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from typing import Any] n5[from services.aiva_common.utils import get_logger] n6[logger = get_logger(__name__)] n7[class CompliancePolicyChecker(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from typing import Any]
    n5[from services.aiva_common.utils import get_logger]
    n6[logger = get_logger(__name__)]
    n7[class CompliancePolicyChecker(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
7. integration aiva integration analysis risk assessment engine enhanced Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\n增強版風險評估引擎\n\n整合業務上下文、資產價值、合規要求等多維度因素進行風險評估...] n4[from __future__ import annotations] n5[from typing import Any] n6[from services.aiva_common.utils import get_logger] n7[logger = get_logger(__name__)] n8[class EnhancedRiskAssessmentEngine(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\n增強版風險評估引擎\n\n整合業務上下文、資產價值、合規要求等多維度因素進行風險評估...]
    n4[from __future__ import annotations]
    n5[from typing import Any]
    n6[from services.aiva_common.utils import get_logger]
    n7[logger = get_logger(__name__)]
    n8[class EnhancedRiskAssessmentEngine(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
8. integration aiva integration analysis risk assessment engine Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from typing import Any] n5[from services.aiva_common.utils import get_logger] n6[logger = get_logger(__name__)] n7[class RiskAssessmentEngine(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from typing import Any]
    n5[from services.aiva_common.utils import get_logger]
    n6[logger = get_logger(__name__)]
    n7[class RiskAssessmentEngine(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
9. integration aiva integration analysis vuln correlation analyzer Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from collections import defaultdict] n5[from typing import Any] n6[from services.aiva_common.utils import get_logger] n7[logger = get_logger(__name__)] n8[class VulnerabilityCorrelationAnalyzer(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from collections import defaultdict]
    n5[from typing import Any]
    n6[from services.aiva_common.utils import get_logger]
    n7[logger = get_logger(__name__)]
    n8[class VulnerabilityCorrelationAnalyzer(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
10. integration aiva integration app Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[import asyncio] n5[from typing import Any] n6[from fastapi import FastAPI, HTTPException] n7[from services.aiva_common.enums import Topic] n8[from services.aiva_common.mq import get_broker] n9[from services.aiva_common.schemas import AivaMessa...] n10[from services.aiva_common.utils import get_logger] n11[from .analysis.compliance_policy_checker import Co...] n12[from .analysis.risk_assessment_engine import RiskA...] n13[from .analysis.vuln_correlation_analyzer import Vu...] n14[from .config_template.config_template_manager impo...] n15[from .perf_feedback.improvement_suggestion_generat...] n16[from .perf_feedback.scan_metadata_analyzer import ...] n17[from .reception.data_reception_layer import DataRe...] n18[from .reception.test_result_database import TestRe...] n19[from .reporting.formatter_exporter import Formatte...] n20[from .reporting.report_content_generator import Re...] n21[from .reporting.report_template_selector import Re...] n22[app = FastAPI(title='AIVA ...] n23[logger = get_logger(__name__)] n24[db = TestResultDatabase()] n25[recv = DataReceptionLayer(d...] n26[corr = VulnerabilityCorrela...] n27[risk = RiskAssessmentEngine...] n28[comp = CompliancePolicyChec...] n29[rptgen = ReportContentGenerat...] n30[fmt = FormatterExporter()] n31[rptsel = ReportTemplateSelect...] n32[smeta = ScanMetadataAnalyzer...] n33[impr = ImprovementSuggestio...] n34[ctm = ConfigTemplateManage...] n35[def startup(...)] n36[def get_finding(...)] n37[def _consume_logs(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n21 n21 --> n22 n22 --> n23 n23 --> n24 n24 --> n25 n25 --> n26 n26 --> n27 n27 --> n28 n28 --> n29 n29 --> n30 n30 --> n31 n31 --> n32 n32 --> n33 n33 --> n34 n34 --> n35 n35 --> n36 n36 --> n37 n37 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[import asyncio]
    n5[from typing import Any]
    n6[from fastapi import FastAPI, HTTPException]
    n7[from services.aiva_common.enums import Topic]
    n8[from services.aiva_common.mq import get_broker]
    n9[from services.aiva_common.schemas import AivaMessa...]
    n10[from services.aiva_common.utils import get_logger]
    n11[from .analysis.compliance_policy_checker import Co...]
    n12[from .analysis.risk_assessment_engine import RiskA...]
    n13[from .analysis.vuln_correlation_analyzer import Vu...]
    n14[from .config_template.config_template_manager impo...]
    n15[from .perf_feedback.improvement_suggestion_generat...]
    n16[from .perf_feedback.scan_metadata_analyzer import ...]
    n17[from .reception.data_reception_layer import DataRe...]
    n18[from .reception.test_result_database import TestRe...]
    n19[from .reporting.formatter_exporter import Formatte...]
    n20[from .reporting.report_content_generator import Re...]
    n21[from .reporting.report_template_selector import Re...]
    n22[app = FastAPI(title='AIVA ...]
    n23[logger = get_logger(__name__)]
    n24[db = TestResultDatabase()]
    n25[recv = DataReceptionLayer(d...]
    n26[corr = VulnerabilityCorrela...]
    n27[risk = RiskAssessmentEngine...]
    n28[comp = CompliancePolicyChec...]
    n29[rptgen = ReportContentGenerat...]
    n30[fmt = FormatterExporter()]
    n31[rptsel = ReportTemplateSelect...]
    n32[smeta = ScanMetadataAnalyzer...]
    n33[impr = ImprovementSuggestio...]
    n34[ctm = ConfigTemplateManage...]
    n35[def startup(...)]
    n36[def get_finding(...)]
    n37[def _consume_logs(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n21
    n21 --> n22
    n22 --> n23
    n23 --> n24
    n24 --> n25
    n25 --> n26
    n26 --> n27
    n27 --> n28
    n28 --> n29
    n29 --> n30
    n30 --> n31
    n31 --> n32
    n32 --> n33
    n33 --> n34
    n34 --> n35
    n35 --> n36
    n36 --> n37
    n37 --> n2
11. integration aiva integration attack path analyzer init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAttack Path Analyzer Package\n\n攻擊路徑分析模組,使...] n4[from .engine import AttackPath, AttackPathEngine, ...] n5[from .graph_builder import GraphBuilder] n6[from .visualizer import AttackPathVisualizer] n7[__all__ = ['AttackPathEngine'...] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAttack Path Analyzer Package\n\n攻擊路徑分析模組,使...]
    n4[from .engine import AttackPath, AttackPathEngine, ...]
    n5[from .graph_builder import GraphBuilder]
    n6[from .visualizer import AttackPathVisualizer]
    n7[__all__ = ['AttackPathEngine'...]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
12. integration aiva integration attack path analyzer engine Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAttack Path Analyzer - 攻擊路徑分析引擎\n\n使用 Neo4...] n4[from dataclasses import dataclass] n5[from enum import Enum] n6[import logging] n7[from typing import Any] n8[from neo4j import GraphDatabase] n9[from services.aiva_common.enums import Severity] n10[from services.aiva_common.schemas import Asset, Fi...] n11[logger = logging.getLogger(__...] n12[class NodeType(...)] n13[class EdgeType(...)] n14[class AttackPath(...)] n15[class AttackPathEngine(...)] n16{if __name__ == '__main__'} n17[logging.basicConfig(level=logging.INFO)] n18[engine = AttackPathEngine(neo...] n19[try] n20[engine.initialize_graph()] n21[paths = engine.find_attack_p...] n22{for path in paths} n23[print(f'\n攻擊路徑 {path.path_id}:&...] n24[print(f' 風險分數: {path.total_risk_sco...] n25[print(f' 路徑長度: {path.length}&a...] n26[print(f' 描述: {path.description}...] n27[] n28[critical_nodes = engine.find_critical...] n29[print('\n關鍵節點:')] n30{for node in critical_nodes} n31[print(f" - {node.get('...] n32[] n33[stats = engine.get_vulnerabi...] n34[print(f"\n漏洞統計: 總計 {stats[&#...] n35{for (severity, count) in stats['b...} n36[print(f' {severity}: {cou...] n37[] n38[] n39[finally] n40[engine.close()] n41[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 -->|Yes| n17 n16 -->|No| n41 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n21 n21 --> n22 n22 -->|Yes| n23 n22 -->|No| n27 n23 --> n24 n24 --> n25 n25 --> n26 n26 --> n22 n27 --> n28 n28 --> n29 n29 --> n30 n30 -->|Yes| n31 n30 -->|No| n32 n31 --> n30 n32 --> n33 n33 --> n34 n34 --> n35 n35 -->|Yes| n36 n35 -->|No| n37 n36 --> n35 n37 --> n38 n38 --> n39 n39 --> n40 n40 --> n41 n41 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAttack Path Analyzer - 攻擊路徑分析引擎\n\n使用 Neo4...]
    n4[from dataclasses import dataclass]
    n5[from enum import Enum]
    n6[import logging]
    n7[from typing import Any]
    n8[from neo4j import GraphDatabase]
    n9[from services.aiva_common.enums import Severity]
    n10[from services.aiva_common.schemas import Asset, Fi...]
    n11[logger = logging.getLogger(__...]
    n12[class NodeType(...)]
    n13[class EdgeType(...)]
    n14[class AttackPath(...)]
    n15[class AttackPathEngine(...)]
    n16{if __name__ == '__main__'}
    n17[logging.basicConfig(level=logging.INFO)]
    n18[engine = AttackPathEngine(neo...]
    n19[try]
    n20[engine.initialize_graph()]
    n21[paths = engine.find_attack_p...]
    n22{for path in paths}
    n23[print(f'\n攻擊路徑 {path.path_id}:&...]
    n24[print(f'  風險分數: {path.total_risk_sco...]
    n25[print(f'  路徑長度: {path.length}&a...]
    n26[print(f'  描述: {path.description&#125...]
    n27[]
    n28[critical_nodes = engine.find_critical...]
    n29[print('\n關鍵節點:')]
    n30{for node in critical_nodes}
    n31[print(f"  - {node.get('...]
    n32[]
    n33[stats = engine.get_vulnerabi...]
    n34[print(f"\n漏洞統計: 總計 {stats[&&#35...]
    n35{for (severity, count) in stats['b...}
    n36[print(f'  {severity}: {cou...]
    n37[]
    n38[]
    n39[finally]
    n40[engine.close()]
    n41[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 -->|Yes| n17
    n16 -->|No| n41
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n21
    n21 --> n22
    n22 -->|Yes| n23
    n22 -->|No| n27
    n23 --> n24
    n24 --> n25
    n25 --> n26
    n26 --> n22
    n27 --> n28
    n28 --> n29
    n29 --> n30
    n30 -->|Yes| n31
    n30 -->|No| n32
    n31 --> n30
    n32 --> n33
    n33 --> n34
    n34 --> n35
    n35 -->|Yes| n36
    n35 -->|No| n37
    n36 --> n35
    n37 --> n38
    n38 --> n39
    n39 --> n40
    n40 --> n41
    n41 --> n2
13. integration aiva integration attack path analyzer nlp recommender Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAttack Path NLP Recommender - 攻擊路徑自然語言推薦系統...] n4[from dataclasses import dataclass] n5[from enum import Enum] n6[from typing import Any] n7[from services.integration.aiva_integration.attack_...] n8[class RiskLevel(...)] n9[class PathRecommendation(...)] n10[class AttackPathNLPRecommender(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAttack Path NLP Recommender - 攻擊路徑自然語言推薦系統...]
    n4[from dataclasses import dataclass]
    n5[from enum import Enum]
    n6[from typing import Any]
    n7[from services.integration.aiva_integration.attack_...]
    n8[class RiskLevel(...)]
    n9[class PathRecommendation(...)]
    n10[class AttackPathNLPRecommender(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n2
14. integration aiva integration attack path analyzer visualizer Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAttack Path Visualizer - 攻擊路徑視覺化\n\n將攻擊路徑匯...] n4[import json] n5[from .engine import AttackPath] n6[class AttackPathVisualizer(...)] n7{if __name__ == '__main__'} n8[from .engine import AttackPathEngine] n9[engine = AttackPathEngine()] n10[try] n11[engine.initialize_graph()] n12[paths = engine.find_attack_p...] n13[mermaid_code = AttackPathVisualizer...] n14[print(mermaid_code)] n15[AttackPathVisualizer.to_html(paths)] n16[] n17[finally] n18[engine.close()] n19[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 -->|Yes| n8 n7 -->|No| n19 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAttack Path Visualizer - 攻擊路徑視覺化\n\n將攻擊路徑匯...]
    n4[import json]
    n5[from .engine import AttackPath]
    n6[class AttackPathVisualizer(...)]
    n7{if __name__ == '__main__'}
    n8[from .engine import AttackPathEngine]
    n9[engine = AttackPathEngine()]
    n10[try]
    n11[engine.initialize_graph()]
    n12[paths = engine.find_attack_p...]
    n13[mermaid_code = AttackPathVisualizer...]
    n14[print(mermaid_code)]
    n15[AttackPathVisualizer.to_html(paths)]
    n16[]
    n17[finally]
    n18[engine.close()]
    n19[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 -->|Yes| n8
    n7 -->|No| n19
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n2
15. integration aiva integration config template init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
16. integration aiva integration config template config template manager Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from typing import Any] n5[from services.aiva_common.utils import get_logger] n6[logger = get_logger(__name__)] n7[class ConfigTemplateManager(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from typing import Any]
    n5[from services.aiva_common.utils import get_logger]
    n6[logger = get_logger(__name__)]
    n7[class ConfigTemplateManager(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
17. integration aiva integration examples enhanced attack path demo Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nEnhanced Attack Path Analysis Demo\n展示如何使用...] n4[import logging] n5[from pathlib import Path] n6[from services.aiva_common.enums import Confidence,...] n7[from services.aiva_common.schemas import Asset, Fi...] n8[from services.integration.aiva_integration.attack_...] n9[from services.integration.aiva_integration.attack_...] n10[logging.basicConfig(level=logging.INFO, format=&&...] n11[logger = logging.getLogger(__...] n12[def demo_basic_attack_path_analysis(...)] n13[def demo_nlp_recommendations(...)] n14[def demo_generate_full_report(...)] n15[def demo_critical_nodes(...)] n16[def demo_vulnerability_statistics(...)] n17[def main(...)] n18{if __name__ == '__main__'} n19[main()] n20[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 -->|Yes| n19 n18 -->|No| n20 n19 --> n20 n20 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nEnhanced Attack Path Analysis Demo\n展示如何使用...]
    n4[import logging]
    n5[from pathlib import Path]
    n6[from services.aiva_common.enums import Confidence,...]
    n7[from services.aiva_common.schemas import Asset, Fi...]
    n8[from services.integration.aiva_integration.attack_...]
    n9[from services.integration.aiva_integration.attack_...]
    n10[logging.basicConfig(level=logging.INFO, format=&&...]
    n11[logger = logging.getLogger(__...]
    n12[def demo_basic_attack_path_analysis(...)]
    n13[def demo_nlp_recommendations(...)]
    n14[def demo_generate_full_report(...)]
    n15[def demo_critical_nodes(...)]
    n16[def demo_vulnerability_statistics(...)]
    n17[def main(...)]
    n18{if __name__ == '__main__'}
    n19[main()]
    n20[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 -->|Yes| n19
    n18 -->|No| n20
    n19 --> n20
    n20 --> n2
18. integration aiva integration examples enhanced risk assessment demo Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\n增強版風險評估引擎使用範例\n\n展示如何使用業務上下文進行風險評估\n&&...] n4[from services.integration.aiva_integration.analysi...] n5[def example_basic_assessment(...)] n6[def example_production_critical_asset(...)] n7[def example_comparison(...)] n8[def example_trend_analysis(...)] n9{if __name__ == '__main__'} n10[example_basic_assessment()] n11[example_production_critical_asset()] n12[example_comparison()] n13[example_trend_analysis()] n14[print('\n' + '=&a...] n15[print('✨ 增強版風險評估引擎示範完成')] n16[print('=' * 80)] n17[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 -->|Yes| n10 n9 -->|No| n17 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\n增強版風險評估引擎使用範例\n\n展示如何使用業務上下文進行風險評估\n&&...]
    n4[from services.integration.aiva_integration.analysi...]
    n5[def example_basic_assessment(...)]
    n6[def example_production_critical_asset(...)]
    n7[def example_comparison(...)]
    n8[def example_trend_analysis(...)]
    n9{if __name__ == '__main__'}
    n10[example_basic_assessment()]
    n11[example_production_critical_asset()]
    n12[example_comparison()]
    n13[example_trend_analysis()]
    n14[print('\n' + '=&a...]
    n15[print('✨ 增強版風險評估引擎示範完成')]
    n16[print('=' * 80)]
    n17[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 -->|Yes| n10
    n9 -->|No| n17
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n2
19. integration aiva integration middlewares init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['中間件模組'] n1 --> n3 n3 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['中間件模組']
    n1 --> n3
    n3 --> n2
20. integration aiva integration middlewares rate limiter Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[import asyncio] n5[from collections import defaultdict] n6[import time] n7[from fastapi import Request, Response] n8[from starlette.middleware.base import BaseHTTPMidd...] n9[class TokenBucket(...)] n10[class RateLimiterMiddleware(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[import asyncio]
    n5[from collections import defaultdict]
    n6[import time]
    n7[from fastapi import Request, Response]
    n8[from starlette.middleware.base import BaseHTTPMidd...]
    n9[class TokenBucket(...)]
    n10[class RateLimiterMiddleware(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n2
21. integration aiva integration observability init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['可觀察性模組'] n1 --> n3 n3 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['可觀察性模組']
    n1 --> n3
    n3 --> n2
22. integration aiva integration observability metrics Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[import time] n5[from typing import Any] n6[try] n7[from prometheus_client import CONTENT_TYPE_LATEST,...] n8[PROMETHEUS_AVAILABLE = True] n9[] n10[except ImportError] n11[PROMETHEUS_AVAILABLE = False] n12[class Metrics(...)] n13[class MetricsTimer(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n6 --> n10 n7 --> n8 n8 --> n9 n9 --> n12 n10 --> n11 n11 --> n9 n12 --> n13 n13 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[import time]
    n5[from typing import Any]
    n6[try]
    n7[from prometheus_client import CONTENT_TYPE_LATEST,...]
    n8[PROMETHEUS_AVAILABLE = True]
    n9[]
    n10[except ImportError]
    n11[PROMETHEUS_AVAILABLE = False]
    n12[class Metrics(...)]
    n13[class MetricsTimer(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n6 --> n10
    n7 --> n8
    n8 --> n9
    n9 --> n12
    n10 --> n11
    n11 --> n9
    n12 --> n13
    n13 --> n2
23. integration aiva integration perf feedback init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
24. integration aiva integration perf feedback improvement suggestion generator Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from typing import Any] n5[from services.aiva_common.utils import get_logger] n6[logger = get_logger(__name__)] n7[class ImprovementSuggestionGenerator(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from typing import Any]
    n5[from services.aiva_common.utils import get_logger]
    n6[logger = get_logger(__name__)]
    n7[class ImprovementSuggestionGenerator(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n2
25. integration aiva integration reception init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
26. integration aiva integration reception data reception layer Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from services.aiva_common.schemas import FindingPa...] n5[from .sql_result_database import SqlResultDatabase...] n6[class DataReceptionLayer(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from services.aiva_common.schemas import FindingPa...]
    n5[from .sql_result_database import SqlResultDatabase...]
    n6[class DataReceptionLayer(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n2
27. integration aiva integration reception experience models Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\n經驗資料庫 (Experience Replay Memory) 模...] n4[from datetime import datetime] n5[from sqlalchemy import Column, DateTime, Float, In...] n6[from sqlalchemy.dialects.postgresql import JSONB] n7[from sqlalchemy.ext.declarative import declarative...] n8[Base = declarative_base()] n9[class ExperienceRecord(...)] n10[class TrainingDataset(...)] n11[class DatasetSample(...)] n12[class ModelTrainingHistory(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\n經驗資料庫 (Experience Replay Memory) 模...]
    n4[from datetime import datetime]
    n5[from sqlalchemy import Column, DateTime, Float, In...]
    n6[from sqlalchemy.dialects.postgresql import JSONB]
    n7[from sqlalchemy.ext.declarative import declarative...]
    n8[Base = declarative_base()]
    n9[class ExperienceRecord(...)]
    n10[class TrainingDataset(...)]
    n11[class DatasetSample(...)]
    n12[class ModelTrainingHistory(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n2
28. integration aiva integration reception experience repository Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\n經驗資料庫存取層 (Experience Repository)\n...] n4[from __future__ import annotations] n5[from datetime import datetime] n6[import logging] n7[from typing import Any] n8[from uuid import uuid4] n9[from sqlalchemy import create_engine, desc, func] n10[from sqlalchemy.orm import Session, sessionmaker] n11[from .experience_models import Base, DatasetSample...] n12[logger = logging.getLogger(__...] n13[class ExperienceRepository(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\n經驗資料庫存取層 (Experience Repository)\n...]
    n4[from __future__ import annotations]
    n5[from datetime import datetime]
    n6[import logging]
    n7[from typing import Any]
    n8[from uuid import uuid4]
    n9[from sqlalchemy import create_engine, desc, func]
    n10[from sqlalchemy.orm import Session, sessionmaker]
    n11[from .experience_models import Base, DatasetSample...]
    n12[logger = logging.getLogger(__...]
    n13[class ExperienceRepository(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n2
29. integration aiva integration reception lifecycle manager Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAsset and Vulnerability Lifecycle Manager\...] n4[from __future__ import annotations] n5[from datetime import datetime, timedelta] n6[import hashlib] n7[from typing import Any] n8[from sqlalchemy import and_] n9[from sqlalchemy.orm import Session] n10[from services.aiva_common.schemas import FindingPa...] n11[from services.aiva_common.utils import get_logger] n12[from .models_enhanced import Asset, AssetStatus, B...] n13[logger = get_logger(__name__)] n14[class AssetVulnerabilityManager(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAsset and Vulnerability Lifecycle Manager\...]
    n4[from __future__ import annotations]
    n5[from datetime import datetime, timedelta]
    n6[import hashlib]
    n7[from typing import Any]
    n8[from sqlalchemy import and_]
    n9[from sqlalchemy.orm import Session]
    n10[from services.aiva_common.schemas import FindingPa...]
    n11[from services.aiva_common.utils import get_logger]
    n12[from .models_enhanced import Asset, AssetStatus, B...]
    n13[logger = get_logger(__name__)]
    n14[class AssetVulnerabilityManager(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n2
30. integration aiva integration reception models enhanced Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nEnhanced Database Models for Asset and Vul...] n4[from __future__ import annotations] n5[from datetime import datetime] n6[from enum import Enum] n7[from typing import Any] n8[from sqlalchemy import Column, DateTime, ForeignKe...] n9[from sqlalchemy.dialects.postgresql import JSONB] n10[from sqlalchemy.ext.declarative import declarative...] n11[from sqlalchemy.orm import relationship] n12[Base = declarative_base()] n13[class BusinessCriticality(...)] n14[class Environment(...)] n15[class AssetType(...)] n16[class AssetStatus(...)] n17[class VulnerabilityStatus(...)] n18[class Severity(...)] n19[class Confidence(...)] n20[class Exploitability(...)] n21[class Asset(...)] n22[class Vulnerability(...)] n23[class VulnerabilityHistory(...)] n24[class VulnerabilityTag(...)] n25[class FindingRecord(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n21 n21 --> n22 n22 --> n23 n23 --> n24 n24 --> n25 n25 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nEnhanced Database Models for Asset and Vul...]
    n4[from __future__ import annotations]
    n5[from datetime import datetime]
    n6[from enum import Enum]
    n7[from typing import Any]
    n8[from sqlalchemy import Column, DateTime, ForeignKe...]
    n9[from sqlalchemy.dialects.postgresql import JSONB]
    n10[from sqlalchemy.ext.declarative import declarative...]
    n11[from sqlalchemy.orm import relationship]
    n12[Base = declarative_base()]
    n13[class BusinessCriticality(...)]
    n14[class Environment(...)]
    n15[class AssetType(...)]
    n16[class AssetStatus(...)]
    n17[class VulnerabilityStatus(...)]
    n18[class Severity(...)]
    n19[class Confidence(...)]
    n20[class Exploitability(...)]
    n21[class Asset(...)]
    n22[class Vulnerability(...)]
    n23[class VulnerabilityHistory(...)]
    n24[class VulnerabilityTag(...)]
    n25[class FindingRecord(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n21
    n21 --> n22
    n22 --> n23
    n23 --> n24
    n24 --> n25
    n25 --> n2
31. integration aiva integration reception sql result database Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from datetime import datetime] n5[from typing import Any] n6[from sqlalchemy import Column, DateTime, Integer, ...] n7[from sqlalchemy.ext.declarative import declarative...] n8[from sqlalchemy.orm import Session, sessionmaker] n9[from services.aiva_common.schemas import FindingPa...] n10[from .test_result_database import TestResultDataba...] n11[Base = declarative_base()] n12[class FindingRecord(...)] n13[class SqlResultDatabase(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from datetime import datetime]
    n5[from typing import Any]
    n6[from sqlalchemy import Column, DateTime, Integer, ...]
    n7[from sqlalchemy.ext.declarative import declarative...]
    n8[from sqlalchemy.orm import Session, sessionmaker]
    n9[from services.aiva_common.schemas import FindingPa...]
    n10[from .test_result_database import TestResultDataba...]
    n11[Base = declarative_base()]
    n12[class FindingRecord(...)]
    n13[class SqlResultDatabase(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n2
32. integration aiva integration reception test result database Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nTest Result Database Interface\n\nAbstract...] n4[from __future__ import annotations] n5[from abc import ABC, abstractmethod] n6[from typing import Any] n7[from services.aiva_common.schemas import FindingPa...] n8[class TestResultDatabase(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nTest Result Database Interface\n\nAbstract...]
    n4[from __future__ import annotations]
    n5[from abc import ABC, abstractmethod]
    n6[from typing import Any]
    n7[from services.aiva_common.schemas import FindingPa...]
    n8[class TestResultDatabase(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
33. integration aiva integration remediation init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nRemediation Module - 自動修復模組\n\n提供自動修復、補丁生成...] n4[from .code_fixer import CodeFixer] n5[from .config_recommender import ConfigRecommender] n6[from .patch_generator import PatchGenerator] n7[from .report_generator import ReportGenerator] n8[__all__ = ['PatchGenerator', ...] n9[__version__ = '1.0.0'] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nRemediation Module - 自動修復模組\n\n提供自動修復、補丁生成...]
    n4[from .code_fixer import CodeFixer]
    n5[from .config_recommender import ConfigRecommender]
    n6[from .patch_generator import PatchGenerator]
    n7[from .report_generator import ReportGenerator]
    n8[__all__ = ['PatchGenerator', ...]
    n9[__version__ = '1.0.0']
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n2
34. integration aiva integration remediation code fixer Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nCode Fixer - 代碼修復器\n\n使用 LLM (OpenAI/L...] n4[import contextlib] n5[from datetime import datetime] n6[import hashlib] n7[from typing import Any] n8[import structlog] n9[try] n10[import litellm] n11[LITELLM_AVAILABLE = True] n12[] n13[except ImportError] n14[LITELLM_AVAILABLE = False] n15[try] n16[import openai] n17[OPENAI_AVAILABLE = True] n18[] n19[except ImportError] n20[OPENAI_AVAILABLE = False] n21[logger = structlog.get_logger...] n22[class CodeFixer(...)] n23[def main(...)] n24{if __name__ == '__main__'} n25[main()] n26[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n9 --> n13 n10 --> n11 n11 --> n12 n12 --> n15 n13 --> n14 n14 --> n12 n15 --> n16 n15 --> n19 n16 --> n17 n17 --> n18 n18 --> n21 n19 --> n20 n20 --> n18 n21 --> n22 n22 --> n23 n23 --> n24 n24 -->|Yes| n25 n24 -->|No| n26 n25 --> n26 n26 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nCode Fixer - 代碼修復器\n\n使用 LLM (OpenAI/L...]
    n4[import contextlib]
    n5[from datetime import datetime]
    n6[import hashlib]
    n7[from typing import Any]
    n8[import structlog]
    n9[try]
    n10[import litellm]
    n11[LITELLM_AVAILABLE = True]
    n12[]
    n13[except ImportError]
    n14[LITELLM_AVAILABLE = False]
    n15[try]
    n16[import openai]
    n17[OPENAI_AVAILABLE = True]
    n18[]
    n19[except ImportError]
    n20[OPENAI_AVAILABLE = False]
    n21[logger = structlog.get_logger...]
    n22[class CodeFixer(...)]
    n23[def main(...)]
    n24{if __name__ == '__main__'}
    n25[main()]
    n26[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n9 --> n13
    n10 --> n11
    n11 --> n12
    n12 --> n15
    n13 --> n14
    n14 --> n12
    n15 --> n16
    n15 --> n19
    n16 --> n17
    n17 --> n18
    n18 --> n21
    n19 --> n20
    n20 --> n18
    n21 --> n22
    n22 --> n23
    n23 --> n24
    n24 -->|Yes| n25
    n24 -->|No| n26
    n25 --> n26
    n26 --> n2
35. integration aiva integration remediation config recommender Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nConfig Recommender - 配置建議器\n\n根據掃描結果提供安全配置...] n4[from datetime import datetime] n5[import hashlib] n6[from pathlib import Path] n7[from typing import Any] n8[from ruamel.yaml import YAML] n9[import structlog] n10[logger = structlog.get_logger...] n11[class ConfigRecommender(...)] n12[def main(...)] n13{if __name__ == '__main__'} n14[main()] n15[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 -->|Yes| n14 n13 -->|No| n15 n14 --> n15 n15 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nConfig Recommender - 配置建議器\n\n根據掃描結果提供安全配置...]
    n4[from datetime import datetime]
    n5[import hashlib]
    n6[from pathlib import Path]
    n7[from typing import Any]
    n8[from ruamel.yaml import YAML]
    n9[import structlog]
    n10[logger = structlog.get_logger...]
    n11[class ConfigRecommender(...)]
    n12[def main(...)]
    n13{if __name__ == '__main__'}
    n14[main()]
    n15[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 -->|Yes| n14
    n13 -->|No| n15
    n14 --> n15
    n15 --> n2
36. integration aiva integration remediation patch generator Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nPatch Generator - 補丁生成器\n\n根據發現的漏洞自動生成修復補丁...] n4[from datetime import datetime] n5[import hashlib] n6[from pathlib import Path] n7[import tempfile] n8[from typing import Any] n9[import git] n10[import structlog] n11[logger = structlog.get_logger...] n12[class PatchGenerator(...)] n13[def main(...)] n14{if __name__ == '__main__'} n15[main()] n16[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 -->|Yes| n15 n14 -->|No| n16 n15 --> n16 n16 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nPatch Generator - 補丁生成器\n\n根據發現的漏洞自動生成修復補丁...]
    n4[from datetime import datetime]
    n5[import hashlib]
    n6[from pathlib import Path]
    n7[import tempfile]
    n8[from typing import Any]
    n9[import git]
    n10[import structlog]
    n11[logger = structlog.get_logger...]
    n12[class PatchGenerator(...)]
    n13[def main(...)]
    n14{if __name__ == '__main__'}
    n15[main()]
    n16[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 -->|Yes| n15
    n14 -->|No| n16
    n15 --> n16
    n16 --> n2
37. integration aiva integration remediation report generator Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nReport Generator - 報告生成器\n\n生成詳細的安全掃描和修復報告...] n4[from datetime import datetime] n5[import hashlib] n6[from pathlib import Path] n7[from typing import Any] n8[from jinja2 import Environment, FileSystemLoader] n9[import structlog] n10[logger = structlog.get_logger...] n11[try] n12[from weasyprint import HTML as WeasyHTML] n13[WEASYPRINT_AVAILABLE = True] n14[] n15[except ImportError] n16[WeasyHTML = None] n17[WEASYPRINT_AVAILABLE = False] n18[logger.warning('weasyprint_not_available&...] n19[try] n20[from reportlab.lib.pagesizes import letter] n21[from reportlab.lib.styles import getSampleStyleShe...] n22[from reportlab.platypus import Paragraph, SimpleDo...] n23[REPORTLAB_AVAILABLE = True] n24[] n25[except ImportError] n26[SimpleDocTemplate = None] n27[Paragraph = None] n28[Spacer = None] n29[letter = None] n30[getSampleStyleSheet = None] n31[REPORTLAB_AVAILABLE = False] n32[logger.warning('reportlab_not_available&a...] n33[class ReportGenerator(...)] n34[def main(...)] n35{if __name__ == '__main__'} n36[main()] n37[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n11 --> n15 n12 --> n13 n13 --> n14 n14 --> n19 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n14 n19 --> n20 n19 --> n25 n20 --> n21 n21 --> n22 n22 --> n23 n23 --> n24 n24 --> n33 n25 --> n26 n26 --> n27 n27 --> n28 n28 --> n29 n29 --> n30 n30 --> n31 n31 --> n32 n32 --> n24 n33 --> n34 n34 --> n35 n35 -->|Yes| n36 n35 -->|No| n37 n36 --> n37 n37 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nReport Generator - 報告生成器\n\n生成詳細的安全掃描和修復報告...]
    n4[from datetime import datetime]
    n5[import hashlib]
    n6[from pathlib import Path]
    n7[from typing import Any]
    n8[from jinja2 import Environment, FileSystemLoader]
    n9[import structlog]
    n10[logger = structlog.get_logger...]
    n11[try]
    n12[from weasyprint import HTML as WeasyHTML]
    n13[WEASYPRINT_AVAILABLE = True]
    n14[]
    n15[except ImportError]
    n16[WeasyHTML = None]
    n17[WEASYPRINT_AVAILABLE = False]
    n18[logger.warning('weasyprint_not_available&...]
    n19[try]
    n20[from reportlab.lib.pagesizes import letter]
    n21[from reportlab.lib.styles import getSampleStyleShe...]
    n22[from reportlab.platypus import Paragraph, SimpleDo...]
    n23[REPORTLAB_AVAILABLE = True]
    n24[]
    n25[except ImportError]
    n26[SimpleDocTemplate = None]
    n27[Paragraph = None]
    n28[Spacer = None]
    n29[letter = None]
    n30[getSampleStyleSheet = None]
    n31[REPORTLAB_AVAILABLE = False]
    n32[logger.warning('reportlab_not_available&a...]
    n33[class ReportGenerator(...)]
    n34[def main(...)]
    n35{if __name__ == '__main__'}
    n36[main()]
    n37[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n11 --> n15
    n12 --> n13
    n13 --> n14
    n14 --> n19
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n14
    n19 --> n20
    n19 --> n25
    n20 --> n21
    n21 --> n22
    n22 --> n23
    n23 --> n24
    n24 --> n33
    n25 --> n26
    n26 --> n27
    n27 --> n28
    n28 --> n29
    n29 --> n30
    n30 --> n31
    n31 --> n32
    n32 --> n24
    n33 --> n34
    n34 --> n35
    n35 -->|Yes| n36
    n35 -->|No| n37
    n36 --> n37
    n37 --> n2
38. integration aiva integration reporting init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n1 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n1 --> n2
39. integration aiva integration reporting formatter exporter Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[import json] n5[from typing import Any] n6[from services.aiva_common.utils import get_logger] n7[logger = get_logger(__name__)] n8[class FormatterExporter(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[import json]
    n5[from typing import Any]
    n6[from services.aiva_common.utils import get_logger]
    n7[logger = get_logger(__name__)]
    n8[class FormatterExporter(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
40. integration aiva integration reporting report content generator Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from datetime import UTC, datetime] n5[from typing import Any] n6[from services.aiva_common.utils import get_logger] n7[logger = get_logger(__name__)] n8[class ReportContentGenerator(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from datetime import UTC, datetime]
    n5[from typing import Any]
    n6[from services.aiva_common.utils import get_logger]
    n7[logger = get_logger(__name__)]
    n8[class ReportContentGenerator(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
41. integration aiva integration reporting report template selector Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from services.aiva_common.utils import get_logger] n5[logger = get_logger(__name__)] n6[class ReportTemplateSelector(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from services.aiva_common.utils import get_logger]
    n5[logger = get_logger(__name__)]
    n6[class ReportTemplateSelector(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n2
42. integration aiva integration security init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['認證和安全模組'] n1 --> n3 n3 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['認證和安全模組']
    n1 --> n3
    n3 --> n2
43. integration aiva integration security auth Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from fastapi import HTTPException, Request, status] n5[from fastapi.security import HTTPAuthorizationCred...] n6[from ..settings import IntegrationSettings] n7[class APIKeyAuth(...)] n8[def require_api_key(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from fastapi import HTTPException, Request, status]
    n5[from fastapi.security import HTTPAuthorizationCred...]
    n6[from ..settings import IntegrationSettings]
    n7[class APIKeyAuth(...)]
    n8[def require_api_key(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
44. integration aiva integration settings Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from dataclasses import dataclass] n5[import os] n6[class IntegrationSettings(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from dataclasses import dataclass]
    n5[import os]
    n6[class IntegrationSettings(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n2
45. integration aiva integration threat intel init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAIVA Module-ThreatIntel\n威脅情報整合模組 - 整合 Vir...] n4[__version__ = '0.1.0'] n5[__all__ = ['IntelAggregator',...] n6[from .intel_aggregator import IntelAggregator] n7[from .ioc_enricher import IOCEnricher] n8[from .mitre_mapper import MitreMapper] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAIVA Module-ThreatIntel\n威脅情報整合模組 - 整合 Vir...]
    n4[__version__ = '0.1.0']
    n5[__all__ = ['IntelAggregator',...]
    n6[from .intel_aggregator import IntelAggregator]
    n7[from .ioc_enricher import IOCEnricher]
    n8[from .mitre_mapper import MitreMapper]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
46. integration aiva integration threat intel threat intel init Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nThreatIntel Module - 威脅情報聚合與分析模組\n\n提供整合多個...] n4[from .intel_aggregator import IntelAggregator] n5[from .ioc_enricher import IOCEnricher] n6[from .mitre_mapper import MitreMapper] n7[__all__ = ['IntelAggregator',...] n8[__version__ = '1.0.0'] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nThreatIntel Module - 威脅情報聚合與分析模組\n\n提供整合多個...]
    n4[from .intel_aggregator import IntelAggregator]
    n5[from .ioc_enricher import IOCEnricher]
    n6[from .mitre_mapper import MitreMapper]
    n7[__all__ = ['IntelAggregator',...]
    n8[__version__ = '1.0.0']
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n2
47. integration aiva integration threat intel threat intel intel aggregator Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nIntel Aggregator - 威脅情報聚合器\n\n整合多個威脅情報源(Vi...] n4[import asyncio] n5[from datetime import datetime, timedelta] n6[import hashlib] n7[import os] n8[from typing import Any] n9[from dotenv import load_dotenv] n10[import httpx] n11[import structlog] n12[from tenacity import retry, retry_if_exception_typ...] n13[import vt] n14[from services.aiva_common.enums import IntelSource...] n15[load_dotenv()] n16[logger = structlog.get_logger...] n17[class IntelAggregator(...)] n18[def main(...)] n19{if __name__ == '__main__'} n20[asyncio.run(main())] n21[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 -->|Yes| n20 n19 -->|No| n21 n20 --> n21 n21 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nIntel Aggregator - 威脅情報聚合器\n\n整合多個威脅情報源(Vi...]
    n4[import asyncio]
    n5[from datetime import datetime, timedelta]
    n6[import hashlib]
    n7[import os]
    n8[from typing import Any]
    n9[from dotenv import load_dotenv]
    n10[import httpx]
    n11[import structlog]
    n12[from tenacity import retry, retry_if_exception_typ...]
    n13[import vt]
    n14[from services.aiva_common.enums import IntelSource...]
    n15[load_dotenv()]
    n16[logger = structlog.get_logger...]
    n17[class IntelAggregator(...)]
    n18[def main(...)]
    n19{if __name__ == '__main__'}
    n20[asyncio.run(main())]
    n21[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 -->|Yes| n20
    n19 -->|No| n21
    n20 --> n21
    n21 --> n2
48. integration aiva integration threat intel threat intel ioc enricher Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nIOC Enricher - IOC 豐富化器\n\n豐富化 IOC(IP/Doma...] n4[import asyncio] n5[from datetime import datetime] n6[import socket] n7[from typing import Any] n8[import geoip2.database] n9[from ipwhois import IPWhois] n10[import structlog] n11[import tldextract] n12[logger = structlog.get_logger...] n13[class IOCEnricher(...)] n14[def main(...)] n15{if __name__ == '__main__'} n16[asyncio.run(main())] n17[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 -->|Yes| n16 n15 -->|No| n17 n16 --> n17 n17 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nIOC Enricher - IOC 豐富化器\n\n豐富化 IOC(IP/Doma...]
    n4[import asyncio]
    n5[from datetime import datetime]
    n6[import socket]
    n7[from typing import Any]
    n8[import geoip2.database]
    n9[from ipwhois import IPWhois]
    n10[import structlog]
    n11[import tldextract]
    n12[logger = structlog.get_logger...]
    n13[class IOCEnricher(...)]
    n14[def main(...)]
    n15{if __name__ == '__main__'}
    n16[asyncio.run(main())]
    n17[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 -->|Yes| n16
    n15 -->|No| n17
    n16 --> n17
    n17 --> n2
49. integration aiva integration threat intel threat intel mitre mapper Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nMITRE Mapper - MITRE ATT&CK 映射器\n\n映射漏...] n4[from datetime import datetime] n5[from enum import Enum] n6[import json] n7[import os] n8[from typing import Any] n9[from mitreattack.stix20 import MitreAttackData] n10[import structlog] n11[logger = structlog.get_logger...] n12[class AttackMatrix(...)] n13[class MitreMapper(...)] n14[def main(...)] n15{if __name__ == '__main__'} n16[main()] n17[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 -->|Yes| n16 n15 -->|No| n17 n16 --> n17 n17 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nMITRE Mapper - MITRE ATT&CK 映射器\n\n映射漏...]
    n4[from datetime import datetime]
    n5[from enum import Enum]
    n6[import json]
    n7[import os]
    n8[from typing import Any]
    n9[from mitreattack.stix20 import MitreAttackData]
    n10[import structlog]
    n11[logger = structlog.get_logger...]
    n12[class AttackMatrix(...)]
    n13[class MitreMapper(...)]
    n14[def main(...)]
    n15{if __name__ == '__main__'}
    n16[main()]
    n17[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 -->|Yes| n16
    n15 -->|No| n17
    n16 --> n17
    n17 --> n2
50. integration alembic env Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['Alembic 遷移環境配置'] n4[import asyncio] n5[from logging.config import fileConfig] n6[import os] n7[from alembic import context] n8[from sqlalchemy import pool] n9[from sqlalchemy.engine import Connection] n10[from sqlalchemy.ext.asyncio import async_engine_fr...] n11[from services.integration.aiva_integration.recepti...] n12[config = context.config] n13{if config.config_file_name is ...} n14[fileConfig(config.config_file_name)] n15[] n16[target_metadata = Base.metadata] n17[def get_database_url(...)] n18[def run_migrations_offline(...)] n19[def do_run_migrations(...)] n20[def run_async_migrations(...)] n21[def run_migrations_online(...)] n22{if context.is_offline_mode()} n23[run_migrations_offline()] n24[run_migrations_online()] n25[] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 -->|Yes| n14 n13 -->|No| n15 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n21 n21 --> n22 n22 -->|Yes| n23 n22 -->|No| n24 n23 --> n25 n24 --> n25 n25 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['Alembic 遷移環境配置']
    n4[import asyncio]
    n5[from logging.config import fileConfig]
    n6[import os]
    n7[from alembic import context]
    n8[from sqlalchemy import pool]
    n9[from sqlalchemy.engine import Connection]
    n10[from sqlalchemy.ext.asyncio import async_engine_fr...]
    n11[from services.integration.aiva_integration.recepti...]
    n12[config = context.config]
    n13{if config.config_file_name is ...}
    n14[fileConfig(config.config_file_name)]
    n15[]
    n16[target_metadata = Base.metadata]
    n17[def get_database_url(...)]
    n18[def run_migrations_offline(...)]
    n19[def do_run_migrations(...)]
    n20[def run_async_migrations(...)]
    n21[def run_migrations_online(...)]
    n22{if context.is_offline_mode()}
    n23[run_migrations_offline()]
    n24[run_migrations_online()]
    n25[]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 -->|Yes| n14
    n13 -->|No| n15
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n21
    n21 --> n22
    n22 -->|Yes| n23
    n22 -->|No| n24
    n23 --> n25
    n24 --> n25
    n25 --> n2
51. integration alembic versions 001 initial schema Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\n資料庫初始化遷移\n\nRevision ID: 001\nRevises:\nCr...] n4[from alembic import op] n5[import sqlalchemy as sa] n6[from sqlalchemy.dialects import postgresql] n7[revision = '001'] n8[down_revision = None] n9[branch_labels = None] n10[depends_on = None] n11[def upgrade(...)] n12[def downgrade(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\n資料庫初始化遷移\n\nRevision ID: 001\nRevises:\nCr...]
    n4[from alembic import op]
    n5[import sqlalchemy as sa]
    n6[from sqlalchemy.dialects import postgresql]
    n7[revision = '001']
    n8[down_revision = None]
    n9[branch_labels = None]
    n10[depends_on = None]
    n11[def upgrade(...)]
    n12[def downgrade(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n2
52. integration api gateway api gateway app Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3[from __future__ import annotations] n4[from datetime import UTC, datetime] n5[import json] n6[from typing import Any] n7[from fastapi import FastAPI] n8[from services.aiva_common.enums import ModuleName,...] n9[from services.aiva_common.mq import get_broker] n10[from services.aiva_common.schemas import AivaMessa...] n11[from services.aiva_common.utils import get_logger,...] n12[app = FastAPI(title='AIVA ...] n13[logger = get_logger(__name__)] n14[class StartScanRequest(...)] n15[def health(...)] n16[def start_scan(...)] n17[def list_scans(...)] n18[def get_scan(...)] n19[def cancel_scan(...)] n20[def pause_scan(...)] n21[def scan_findings(...)] n22[def get_finding(...)] n23[def list_assets(...)] n24[def generate_report(...)] n25[def get_report(...)] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n21 n21 --> n22 n22 --> n23 n23 --> n24 n24 --> n25 n25 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3[from __future__ import annotations]
    n4[from datetime import UTC, datetime]
    n5[import json]
    n6[from typing import Any]
    n7[from fastapi import FastAPI]
    n8[from services.aiva_common.enums import ModuleName,...]
    n9[from services.aiva_common.mq import get_broker]
    n10[from services.aiva_common.schemas import AivaMessa...]
    n11[from services.aiva_common.utils import get_logger,...]
    n12[app = FastAPI(title='AIVA ...]
    n13[logger = get_logger(__name__)]
    n14[class StartScanRequest(...)]
    n15[def health(...)]
    n16[def start_scan(...)]
    n17[def list_scans(...)]
    n18[def get_scan(...)]
    n19[def cancel_scan(...)]
    n20[def pause_scan(...)]
    n21[def scan_findings(...)]
    n22[def get_finding(...)]
    n23[def list_assets(...)]
    n24[def generate_report(...)]
    n25[def get_report(...)]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n21
    n21 --> n22
    n22 --> n23
    n23 --> n24
    n24 --> n25
    n25 --> n2
53. integration models Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAIVA Integration Models - 整合服務模組\n\n此文件包含與...] n4[from __future__ import annotations] n5[from datetime import UTC, datetime] n6[from typing import Any] n7[from pydantic import BaseModel, Field] n8[from ..aiva_common.enums import IntelSource, IOCTy...] n9[class ThreatIntelLookupPayload(...)] n10[class ThreatIntelResultPayload(...)] n11[class EnhancedIOCRecord(...)] n12[class SIEMEventPayload(...)] n13[class SIEMEvent(...)] n14[class NotificationPayload(...)] n15[class WebhookPayload(...)] n16[__all__ = ['ThreatIntelLookupP...] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAIVA Integration Models - 整合服務模組\n\n此文件包含與...]
    n4[from __future__ import annotations]
    n5[from datetime import UTC, datetime]
    n6[from typing import Any]
    n7[from pydantic import BaseModel, Field]
    n8[from ..aiva_common.enums import IntelSource, IOCTy...]
    n9[class ThreatIntelLookupPayload(...)]
    n10[class ThreatIntelResultPayload(...)]
    n11[class EnhancedIOCRecord(...)]
    n12[class SIEMEventPayload(...)]
    n13[class SIEMEvent(...)]
    n14[class NotificationPayload(...)]
    n15[class WebhookPayload(...)]
    n16[__all__ = ['ThreatIntelLookupP...]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n2
54. integration service schemas Module
flowchart integration
flowchart TB n1([開始]) n2([結束]) n3['\nAIVA 整合服務模式定義\n\n包含威脅情報、SIEM整合、資產生命週期管理等外部...] n4[from __future__ import annotations] n5[from datetime import UTC, datetime] n6[from typing import Any] n7[from services.aiva_common.enums import DataSource,...] n8[from pydantic import BaseModel, Field] n9[class IOCRecord(...)] n10[class ThreatIndicator(...)] n11[class ThreatIntelPayload(...)] n12[class SIEMEvent(...)] n13[class SIEMIntegrationConfig(...)] n14[class AssetLifecycleEvent(...)] n15[class AssetVulnerabilityManager(...)] n16[class ThirdPartyAPIConfig(...)] n17[class WebhookPayload(...)] n18[class EASMAsset(...)] n19[class EASMDiscoveryJob(...)] n20[__all__ = ['IOCRecord', &...] n1 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8 n8 --> n9 n9 --> n10 n10 --> n11 n11 --> n12 n12 --> n13 n13 --> n14 n14 --> n15 n15 --> n16 n16 --> n17 n17 --> n18 n18 --> n19 n19 --> n20 n20 --> n2
flowchart TB
    n1([開始])
    n2([結束])
    n3['\nAIVA 整合服務模式定義\n\n包含威脅情報、SIEM整合、資產生命週期管理等外部...]
    n4[from __future__ import annotations]
    n5[from datetime import UTC, datetime]
    n6[from typing import Any]
    n7[from services.aiva_common.enums import DataSource,...]
    n8[from pydantic import BaseModel, Field]
    n9[class IOCRecord(...)]
    n10[class ThreatIndicator(...)]
    n11[class ThreatIntelPayload(...)]
    n12[class SIEMEvent(...)]
    n13[class SIEMIntegrationConfig(...)]
    n14[class AssetLifecycleEvent(...)]
    n15[class AssetVulnerabilityManager(...)]
    n16[class ThirdPartyAPIConfig(...)]
    n17[class WebhookPayload(...)]
    n18[class EASMAsset(...)]
    n19[class EASMDiscoveryJob(...)]
    n20[__all__ = ['IOCRecord', &...]
    n1 --> n3
    n3 --> n4
    n4 --> n5
    n5 --> n6
    n6 --> n7
    n7 --> n8
    n8 --> n9
    n9 --> n10
    n10 --> n11
    n11 --> n12
    n12 --> n13
    n13 --> n14
    n14 --> n15
    n15 --> n16
    n16 --> n17
    n17 --> n18
    n18 --> n19
    n19 --> n20
    n20 --> n2